<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>编译模板解析</title>
</head>
<body>
    <!-- <h1>我是index</h1> -->
    <div id="main"></div>
    <script src="/xuni/bundle.js"></script>
    <script>
        var data = {
            students: [
                {name: '小明', age: 12, hobbies: ['游泳', '羽毛球']},
                {name: '小红', age: 15, hobbies: ['足球', '篮球', '羽毛球']}
            ]
        };
        var templateStr = `
        <ul>
                {{#students}}
                <li class="myli">
                    {{name}}的爱好是：
                    <ol>
                        {{#hobbies}}
                        <li>{{.}}</li>
                        {{/hobbies}}
                    </ol>
                </li>
                {{/students}}
            </ul>
        `;
        var htmlStr = SSG_templateEngine.render(templateStr, data)
        document.getElementById('main').innerHTML = htmlStr
    </script>
</body>
</html>